package taller2.view.menus.supervisor;

import java.awt.Color;

import javax.swing.JComboBox;
import javax.swing.JToggleButton;

import taller2.controller.listeners.SupervisorMenus.FordFulkersonSupervisorMenuListener;
import taller2.controller.modes.supervisor.FordFulkersonSupervisorButtonListener;
import taller2.interfaces.Graph;
import taller2.utils.Constants;
import taller2.utils.Utils;
import taller2.view.draws.DrawingArea;
import taller2.view.windows.supervisor.SupervisorWindow;

public class FordFulkersonSupervisorMenu extends GraphSupervisorMenu{
	private static final long serialVersionUID = 1L;
	private JToggleButton validateButton;

	public FordFulkersonSupervisorMenu(DrawingArea area, Graph graph,  Graph solution, 
			SupervisorWindow window) {
		super(area, graph, window);
		
		validateButton = new JToggleButton("Validate");
		validateButton.addActionListener(new FordFulkersonSupervisorButtonListener(graph,solution,this));

		Utils.addComponent(this,validateButton,0.4,1,new taller2.utils.Point(1,0));

	}
	
	protected void createOptions(DrawingArea area,Graph graph){
		options = new JComboBox<String>(Constants.FordFulkersonSupervisorOptions);
		options.setSelectedIndex(0);
		options.setBackground(new Color(0,0,0));
		options.addActionListener(new FordFulkersonSupervisorMenuListener(area,graph, null));
	}

	public void unselectButtons(){
		validateButton.setSelected(false);
	}

}
